<?php
$servidor="localhost"; // Nuestro servidor  
$database="idiomas_db"; // Nombre de nuestra base de datos  
$password="root"; // Nuestro password  
$usuario="root"; // Nombre de nuestro usuario  

$db=mysql_connect($servidor,$usuario,$password);
if (!$db)  {die('No existe la base de datos: ' . mysql_error($db)); }
else mysql_select_db($database, $db) or die('No se puede conectar a la base de datos: ' . mysql_error());


$a1=$_POST["a1"];
$b1=$_POST["b1"];
$c1=$_POST["c1"];

$a2=$_POST["a2"];
$b2=$_POST["b2"];
$c2=$_POST["c2"];

$a3=$_POST["a3"];
$b3=$_POST["b3"];
$c3=$_POST["c3"];

$a4=$_POST["a4"];
$b4=$_POST["b4"];
$c4=$_POST["c4"];

$a5=$_POST["a5"];
$b5=$_POST["b5"];
$c5=$_POST["c5"];

$a6=$_POST["a6"];
$b6=$_POST["b6"];
$c6=$_POST["c6"];

$a7=$_POST["a7"];
$b7=$_POST["b7"];
$c7=$_POST["c7"];

$a8=$_POST["a8"];
$b8=$_POST["b8"];
$c8=$_POST["c8"];

$a9=$_POST["a9"];
$b9=$_POST["b9"];
$c9=$_POST["c9"];

$ano=$_POST["ano"];




if ($a1==""){$a1="--";}
if ($b1==""){$b1="--";}
if ($c1==""){$c1="--";}
if ($a2==""){$a2="--";}
if ($b2==""){$b2="--";}
if ($c2==""){$c2="--";}
if ($a3==""){$a3="--";}
if ($b3==""){$b3="--";}
if ($c3==""){$c3="--";}
if ($a4==""){$a4="--";}
if ($b4==""){$b4="--";}
if ($c4==""){$c4="--";}
if ($a5==""){$a5="--";}
if ($b5==""){$b5="--";}
if ($c5==""){$c5="--";}
if ($a6==""){$a6="--";}
if ($b6==""){$b6="--";}
if ($c6==""){$c6="--";}
if ($a7==""){$a7="--";}
if ($b7==""){$b7="--";}
if ($c7==""){$c7="--";}
if ($a8==""){$a8="--";}
if ($b8==""){$b8="--";}
if ($c8==""){$c8="--";}
if ($a9==""){$a9="--";}
if ($b9==""){$b9="--";}
if ($c9==""){$c9="--";}
if ($ano==""){$ano="--";}

//$fecha=$_POST["fecha"];

$query = "UPDATE matricula SET a1 = '$a1',b1 = '$b1',c1 = '$c1',a2 = '$a2',b2 = '$b2',c2 = '$c2',a3 = '$a3',b3 = '$b3',c3 = '$c3',a4 = '$a4', b4 = '$b4', c4 = '$c4',a5 = '$a5',b5 = '$b5',c5 = '$c5',a6 = '$a6',b6 = '$b6',c6 = '$c6',a7 = '$a7',b7 = '$b7',c7 = '$c7',a8 = '$a8',b8 = '$b8',c8 = '$c8',a9 = '$a9',b9 = '$b9',c9 = '$c9', ano='$ano';";	


/*$query = "INSERT INTO matricula (, b1, c1,a2, b2, c2,a3, b3, c3,a4, b4, c4,a5, b5, c5,a6, b6, c6,a7, b7, c7,a8, b8, c8,a9, b9, c9) values ('$','$b1','$c1','$a2','$b2','$c2','$a3','$b3','$c3','$a4','$b4','$c4','$a5','$b5','$c5','$a6','$b6','$c6','$a7','$b7','$c7','$a8','$b8','$c8','$a9','$b9','$c9');";*/
  	
//echo $query;

$result = mysql_query($query,$db);

		if( !$result )
			{
			echo "Error_db1";
			exit;}
			else {
 header("Location:index.php?opt=admin&ok=si&pag=matricula"); 
					
			}
mysql_close($db);


?>





